<style lang="less" scoped>
.cerebrovascular-project {
  width: 100%;
  height: 100%;
  /deep/.el-table__inner-wrapper {
    height: 100% !important;
  }
  /deep/.el-dialog__header {
    text-align: center;
  }
  .shaixuan {
    display: flex;
    align-items: center;
    justify-content: end;
    background: #fff;
    padding: 5px;
    img {
      height: 20px;
    }
  }
  .box-img {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 300px;
    div {
      width: 48%;
      height: 100%;
    }
  }
  .box-video {
    width: 100%;
    margin-top: 10px;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .box-totip {
    margin-top: 10px;
    div {
      margin: 5px 0;
      word-wrap: break-word;
    }
  }
  .pagination-css {
    padding: 5px;
    box-sizing: border-box;
    background-color: #fff;
    display: flex;
    justify-content: right;
    margin-top: 5px;
  }
}
</style>

<template>
  <div
    class="cerebrovascular-project"
    v-loading.fullscreen.lock="fullscreenLoading"
  >
    <el-form
      :inline="true"
      :model="formInline"
      class="demo-form-inline form-css"
    >
      <el-form-item label="关键字：">
        <el-input
          v-model="formInline.keyword"
          placeholder="请输入条码、姓名、设备名称"
        />
      </el-form-item>
      <el-form-item label="检查时间：">
        <el-date-picker
          v-model="formInline.inspectionTime"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="YYYY-MM-DD"
          style="width: 300px"
        />
      </el-form-item>
      <el-form-item label="上传时间：">
        <el-date-picker
          v-model="formInline.uploadTime"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="YYYY-MM-DD HH:mm:ss"
          style="width: 300px"
        />
      </el-form-item>
      <el-form-item label="报告时间：">
        <el-date-picker
          v-model="formInline.reportTime"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="YYYY-MM-DD HH:mm:ss"
          style="width: 300px"
        />
      </el-form-item>
      <el-form-item label="项目点名称：">
        <el-select v-model="formInline.projectName" filterable placeholder="">
          <el-option v-for="(item, index) in projectList" :key="index" :label="item.insname" :value="item.insname" />
        </el-select>
        <!-- <el-input v-model="formInline.projectName" placeholder="" /> -->
      </el-form-item>
      <el-form-item label="审核机构名称：">
        
        <el-select v-model="formInline.auditorName" filterable placeholder="">
          <el-option v-for="(item, index) in projectList" :key="index" :label="item.insname" :value="item.insname" />
        </el-select>
        <!-- <el-input v-model="formInline.auditorName" placeholder="" /> -->
      </el-form-item>
      <el-form-item label="审核医师：">
        <el-input v-model="formInline.auditorDoctor" placeholder="" />
      </el-form-item>
      <el-form-item label="报告状态：">
        <el-select v-model="formInline.reportStatus" placeholder="">
          <el-option
            v-for="item in statusList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="是否有效：">
        <el-select v-model="formInline.isInvalid" placeholder="请选择">
          <el-option
            v-for="item in isUsedList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="诊断结论：">
        <el-input v-model="formInline.diagnosis" placeholder=""></el-input>
      </el-form-item>
      <el-form-item label="是否阳性：">
        <el-select v-model="formInline.isPositive" placeholder="请选择">
          <el-option
            v-for="item in isPositiveList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary" @click="search"
          ><el-icon style="margin-right: 6px"><Search /></el-icon>
          搜索</el-button
        >
        <el-button @click="reset"
          ><el-icon style="margin-right: 6px"><Refresh /></el-icon>
          重置</el-button
        >
        <vue3-json-excel
          :fields="json_fields"
          :name="userExcelName"
          :fetch="downloadEx"
          style="margin-left: 12px"
        >
          <el-button>
            <!-- <el-icon style="margin-right: 6px"><Document /></el-icon> -->
            <img
              style="margin-right: 6px; width: 12px"
              src="@/images/daochu.png"
              alt=""
            />

            导出</el-button
          >
        </vue3-json-excel>
        <!-- <el-button type="primary"><el-icon><Document /></el-icon>导出</el-button> -->
      </el-form-item>
    </el-form>
    <div class="filter-column">
      <el-popover
        placement="bottom"
        title="筛选条件"
        :width="150"
        trigger="click"
      >
        <el-checkbox-group v-model="filtrateList" @change="changeBox">
          <el-checkbox label="t_sn">条码</el-checkbox>
          <el-checkbox label="project">项目类型</el-checkbox>
          <el-checkbox label="insname">机构名称</el-checkbox>
          <el-checkbox label="name">姓名</el-checkbox>
          <el-checkbox label="sex">性别</el-checkbox>
          <el-checkbox label="age">年龄</el-checkbox>
          <el-checkbox label="isPositive">是否阳性</el-checkbox>
          <el-checkbox label="diagnosis">诊断结论</el-checkbox>
          <el-checkbox label="isInvalid">是否有效</el-checkbox>
          <el-checkbox label="invalidReason">无效原因</el-checkbox>
          <el-checkbox label="devname">设备名称</el-checkbox>
          <el-checkbox label="auditstatus">报告状态</el-checkbox>
          <el-checkbox label="dicomurl">常规报告</el-checkbox>
          <el-checkbox label="upstat">国家报告</el-checkbox>
          <el-checkbox label="videourl">原始影像</el-checkbox>
          <el-checkbox label="checkTime">检查时间</el-checkbox>
          <el-checkbox label="docname">检查医师</el-checkbox>
          <el-checkbox label="uploadTime">上传时间</el-checkbox>
          <el-checkbox label="analyseDoc">分析医师</el-checkbox>
          <el-checkbox label="reportTime">报告时间</el-checkbox>
          <el-checkbox label="auditinsname">审核机构名称</el-checkbox>
          <el-checkbox label="auditname">审核医师</el-checkbox>
          <el-checkbox label="audittm">审核时间</el-checkbox>
          <el-checkbox label="devid">设备SN</el-checkbox>
          <el-checkbox label="origins">登记机构</el-checkbox>
          <el-checkbox label="upstatus">上传状态</el-checkbox>
        </el-checkbox-group>
        <template #reference>
          <el-button type="text"
            ><div class="shaixuan">
              <img src="@/images/shaixuan.png" alt="" /> 筛选列
            </div></el-button
          >
        </template>
      </el-popover>
    </div>
    <el-table
      v-loading="tableLoading"
      :data="tableData"
      :header-cell-style="{ backgroundColor: '#EEF6FF' }"
      stripe
      border
      height="calc(100% - 323px)"
      style="width: 100%; padding: 10px"
    >
      <el-table-column type="index" width="50" align="center" />
      <el-table-column
        v-if="filtrateList.includes('t_sn')"
        prop="t_sn"
        min-width="120px"
        label="条码"
        align="center"
        show-overflow-tooltip
      />
      <el-table-column
        v-if="filtrateList.includes('project')"
        prop="project"
        min-width="120px"
        label="项目类型"
        align="center"
      />
      <!-- <el-table-column
        v-if="filtrateList.includes('insname') && $store.getters.name == 'admin'"
        prop="insname"
        min-width="200px"
        label="机构名称"
        align="center"
      >
        <template #default="scoped">
          <div v-if="!scoped.row.isEdit" @click="choseInsname(scoped.row, scoped.$index)" :style="{color: '#409eff', width: '175px', height: scoped.row.insname ? '100%' : '23px'}">{{ scoped.row.insname }}</div>
          <div v-else style="display: flex; align-items: center;">
            <el-select v-model="scoped.row.insname1" filterable placeholder="">
              <el-option v-for="(item, index) in projectList" :key="index" :label="item.insname" :value="item.insname" />
            </el-select>
            <span @click="submitInsname(scoped.row, scoped.$index)"><el-icon><Check /></el-icon></span>
            <span @click="scoped.row.isEdit = false"><el-icon><Close /></el-icon></span>
          </div>
        </template>
      </el-table-column> -->
      <el-table-column
        v-if="filtrateList.includes('insname')"
        prop="insname"
        min-width="200px"
        label="机构名称"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('name')"
        prop="name"
        min-width="80px"
        label="姓名"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('sex')"
        prop="sex"
        min-width="80px"
        label="性别"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('age')"
        prop="age"
        min-width="84px"
        label="年龄"
        align="center"
      >
        <template #default="{ row }">
          <span>{{ row.age == 0 ? "-" : row.age }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('isPositive')"
        prop="isPositive"
        min-width="160px"
        label="是否阳性"
        align="center"
      >
        <template #default="{ row }">
          <span>{{ row.isPositive == "1" ? "阳性" : row.isPositive == "0" ? "阴性" : "" }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('isInvalid')"
        prop="isInvalid"
        min-width="160px"
        label="是否有效"
        align="center"
      >
        <template #header>
          <el-popover
            placement="bottom-start"
            title="提示"
            :width="300"
            trigger="hover"
            content="“无效”表示扫查结果不合格，无法出具报告，需要重新扫查，请等待处理"
          >
            <template #reference>
              <span
                >是否有效<el-icon style="color: rgb(66, 206, 206)"
                  ><WarningFilled /></el-icon
              ></span>
            </template>
          </el-popover>
        </template>
        <template #default="{ row }">
          <span :style="{ color: row.isInvalid == '1' ? 'red' : '' }">{{
            row.isInvalid == 1 ? "无效" : "有效"
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('diagnosis')"
        prop="diagnosis"
        min-width="160px"
        label="诊断结论"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('invalidReason')"
        prop="invalidReason"
        min-width="120px"
        label="无效原因"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('devname')"
        prop="devname"
        min-width="120px"
        label="设备名称"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('auditstatus')"
        prop="auditstatus"
        min-width="84px"
        label="报告状态"
        align="center"
      >
        <template #default="{ row }">
          <span>{{
            row.auditstatus == 0
              ? "待审核"
              : row.auditstatus == 1
              ? "审核中"
              : row.auditstatus == 2
              ? "退回重审"
              : row.auditstatus == 10
              ? "已审核"
              : ""
          }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('dicomurl')"
        prop="dicomurl"
        min-width="120px"
        label="常规报告"
        align="center"
        show-overflow-tooltip
      >
        <template #default="{ row }">
          <span @click="regularInfo(row)" style="cursor: pointer"
            ><el-icon><Document /></el-icon
          ></span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('upstat')"
        prop="upstat"
        min-width="84px"
        label="国家报告"
        align="center"
      >
        <template #default="{ row }">
          <span @click="nationalInfo(row)" style="cursor: pointer"
            ><el-icon><Document /></el-icon
          ></span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('videourl')"
        prop="dicomurl"
        min-width="120px"
        label="原始影像"
        align="center"
        show-overflow-tooltip
      >
        <template #default="{ row }">
          <span
            v-if="row.dicomurl"
            v-for="(item, index) in row.dicomurl.split(',')"
            :key="index"
          >
            <a
              :href="'https://ultrasound.cdhyhs.com/#/?dicom=' + item"
              target="_blank"
              :style="{ pointerEvents: !item ? 'none' : '' }"
              ><el-icon><Document /></el-icon
            ></a>
          </span>
          <!-- <a :href="'https://ultrasound.cdhyhs.com/#/?dicom=' + row.dicomurl" target="_blank" :style="{pointerEvents: !row.dicomurl ? 'none' : ''}"><el-icon><Document /></el-icon></a> -->
          <!-- <span @click="originalInfo(row)" style="cursor: pointer;"><el-icon><Document /></el-icon></span> -->
        </template>
      </el-table-column>
      <el-table-column
        v-if="filtrateList.includes('checkTime')"
        min-width="160px"
        prop="checkTime1"
        label="检查时间"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('docname')"
        prop="docname"
        min-width="100px"
        label="检查医师"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('uploadTime')"
        prop="uploadTime1"
        min-width="160px"
        label="上传时间"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('analyseDoc')"
        prop="analyseDoc"
        min-width="84px"
        label="分析医师"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('reportTime')"
        prop="reportTime1"
        min-width="160px"
        label="报告时间"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('auditinsname')"
        prop="auditinsname"
        min-width="120px"
        label="审核机构名称"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('auditname')"
        prop="auditname"
        min-width="120px"
        label="审核医师"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('audittm')"
        prop="audittm"
        min-width="120px"
        label="审核时间"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('devid')"
        prop="devid"
        min-width="120px"
        label="设备SN"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('origins')"
        prop="origins"
        min-width="120px"
        label="登记机构"
        align="center"
      />
      <el-table-column
        v-if="filtrateList.includes('upstatus')"
        prop="upstat"
        min-width="120px"
        label="上传状态"
        align="center"
      >
        <template #default="{ row }">
          {{ row.upstat == 200 ? '上传成功' : '上传失败' }}
        </template>
      </el-table-column>
      <el-table-column
        v-if="$store.getters.name == 'admin'"
        label="操作"
        align="center"
        min-width="90px"
      >
        <template #default="{ row }">
          <el-button
            type="primary"
            link
            @click="edit(row)"
          >
            编辑
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      v-model:current-page="pageList.current"
      v-model:page-size="pageList.size"
      :page-sizes="[20, 40, 60, 80]"
      small="small"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pageList.total"
      class="pagination-css"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
    <el-dialog
      v-model="regularVisible"
      width="800px"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
    >
      <template #title>
        <span>{{ $store.getters.insname }}</span>
      </template>

      <div>
        <span style="width: 100%; text-align: center; display: inline-block"
          >超声筛查报告单</span
        >
        <el-divider style="margin: 10px 0" />
        <el-form inline>
          <el-row>
            <el-col :span="8">
              <el-form-item label="姓名：">{{ regularObj.name }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="性别：">{{ regularObj.sex }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="年龄：">{{ regularObj.age }}岁</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="申请机构：">{{
                regularObj.insname
              }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="患者ID：">{{
                regularObj.t_sn
              }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="检查部位：">{{ "颈动脉" }}</el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <el-divider style="margin: 10px 0" />
        <div class="box-img">
          <div>
            <el-image
              style="width: 100%; height: 100%"
              :src="regularObj.screenshot1Url"
              fit="contain"
              :preview-src-list="[regularObj.screenshot1Url]"
            />
          </div>
          <div>
            <el-image
              style="width: 100%; height: 100%"
              :src="regularObj.screenshot2Url"
              fit="contain"
              :preview-src-list="[regularObj.screenshot2Url]"
            />
          </div>
        </div>
        <div class="box-totip">
          <span>超声描述：</span>
          <div>
            {{
              regularObj.json
                ? JSON.parse(regularObj.json).description
                  ? JSON.parse(regularObj.json).description
                  : ""
                : ""
            }}
          </div>
          <span>超声提示：</span>
          <div>
            {{
              JSON.parse(regularObj.json).summary
                ? JSON.parse(regularObj.json).summary
                : ""
            }}
          </div>
        </div>
        <!-- <div style="font-size: 20px; font-weight: 600">其他信息：</div> -->
        <el-form inline>
          <el-row>
            <el-col :span="8">
              <el-form-item label="报告时间：">{{
                regularObj.reportTime2
              }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="检查医师：">{{
                regularObj.docname
              }}</el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="报告医师：">{{
                regularObj.auditname
              }}</el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div style="height: 3px; background-color: #666;"></div>
        <div style="font-size: 12px; font-weight: 400">
          告知：1、超声检查准确性受诸多因素影响，如患者自身因素(肥胖、气体干扰、准备不充分、不能配合、病变位置特殊、疾病所处不同阶段)，设备因素(仪器型号及性能不同,其图像质量和分辨率有差异)、检查者因素(超声结论是以国内外公认的影像特征为依据，不同检査者对超声影像的判读可能存在差异)等，此报告是影像检查结果，请以病理诊断或临床最后诊断为准，与本次检查相关的医疗活动应充分了解上述因素并与临床医生沟通。2、本报告仅作参考，不作为证明或诊断材料。3、本报告仅对本次检查数据有效。
        </div>
      </div>
    </el-dialog>
    <el-dialog
      v-model="nationalVisible"
      width="800px"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
    >
      <template #title>
        <span>{{ "颈动脉脑卒中项目" }}</span>
      </template>
      <table border="1" style="width: 100%; border-collapse: collapse">
        <tbody>
          <tr>
            <td colspan="1">检查时间</td>
            <td colspan="2">
              {{ regularObj.checkTime2 ? regularObj.checkTime2 : "" }}
            </td>
            <td colspan="2">检查人</td>
            <td colspan="3">
              {{ regularObj.docname ? regularObj.docname : "" }}
            </td>
            <td colspan="1">检查机构名称</td>
            <td colspan="3">
              {{ regularObj.insname ? regularObj.insname : "" }}
            </td>
          </tr>
          <tr>
            <td colspan="12">
              检查结果：
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).resultException
                    ? JSON.parse(regularObj.json).resultException == "0"
                      ? "全部正常"
                      : JSON.parse(regularObj.json).resultException == "1"
                      ? "任一部位有异常"
                      : ""
                    : ""
                  : ""
              }}
            </td>
          </tr>
          <tr align="center">
            <td rowspan="3" width="80px">异常类型</td>
            <td rowspan="3">异常项目</td>
            <td colspan="10">责任病灶部位（注：本节中“口”填写相应数字）</td>
          </tr>
          <tr align="center">
            <td colspan="5">左侧</td>
            <td colspan="5">右侧</td>
          </tr>
          <tr align="center">
            <td>颈总</td>
            <td>窦部</td>
            <td>颈内</td>
            <td>锁骨下动脉SA</td>
            <td>椎动脉VA</td>
            <td>颈总</td>
            <td>窦部</td>
            <td>颈内</td>
            <td>锁骨下动脉SA</td>
            <td>椎动脉VA</td>
          </tr>
          <tr align="center">
            <td>内膜IMT</td>
            <td>增厚(IMT≥1.0mm)(1=是, 0=否)</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).intimaImtAacL
                    ? JSON.parse(regularObj.json).intimaImtAacL
                    : ""
                  : ""
              }}
            </td>
            <td>\</td>
            <td>\</td>
            <td>\</td>
            <td>\</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).intimaImtAacR
                    ? JSON.parse(regularObj.json).intimaImtAacR
                    : ""
                  : ""
              }}
            </td>
            <td>\</td>
            <td>\</td>
            <td>\</td>
            <td>\</td>
          </tr>
          <tr>
            <td rowspan="4" align="center">斑块</td>
            <td align="center">数量</td>
            <td colspan="10" style="padding-left: 10px">
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueCount
                    ? JSON.parse(regularObj.json).plaqueCount == "0"
                      ? "无"
                      : JSON.parse(regularObj.json).plaqueCount == "1"
                      ? "单发"
                      : JSON.parse(regularObj.json).plaqueCount == "2"
                      ? "多发"
                      : ""
                    : ""
                  : ""
              }}
            </td>
          </tr>
          <tr>
            <td>形态(1=不规则, 0=规则)</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormAacL
                    ? JSON.parse(regularObj.json).plaqueFormAacL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormSinusL
                    ? JSON.parse(regularObj.json).plaqueFormSinusL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormIcaL
                    ? JSON.parse(regularObj.json).plaqueFormIcaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormSaL
                    ? JSON.parse(regularObj.json).plaqueFormSaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormVaL
                    ? JSON.parse(regularObj.json).plaqueFormVaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormAacR
                    ? JSON.parse(regularObj.json).plaqueFormAacR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormSinusR
                    ? JSON.parse(regularObj.json).plaqueFormSinusR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormIcaR
                    ? JSON.parse(regularObj.json).plaqueFormIcaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormSaR
                    ? JSON.parse(regularObj.json).plaqueFormSaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueFormVaR
                    ? JSON.parse(regularObj.json).plaqueFormVaR
                    : ""
                  : ""
              }}
            </td>
          </tr>
          <tr>
            <td>溃疡(1=有, 0=无)</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerAacL
                    ? JSON.parse(regularObj.json).plaqueUlcerAacL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerSinusL
                    ? JSON.parse(regularObj.json).plaqueUlcerSinusL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerIcaL
                    ? JSON.parse(regularObj.json).plaqueUlcerIcaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerSaL
                    ? JSON.parse(regularObj.json).plaqueUlcerSaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerVaL
                    ? JSON.parse(regularObj.json).plaqueUlcerVaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerAacR
                    ? JSON.parse(regularObj.json).plaqueUlcerAacR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerSinusR
                    ? JSON.parse(regularObj.json).plaqueUlcerSinusR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerIcaR
                    ? JSON.parse(regularObj.json).plaqueUlcerIcaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerSaR
                    ? JSON.parse(regularObj.json).plaqueUlcerSaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueUlcerVaR
                    ? JSON.parse(regularObj.json).plaqueUlcerVaR
                    : ""
                  : ""
              }}
            </td>
          </tr>
          <tr>
            <td>回声(1=强回声，2=中等回声，3=低回声，4=混合回声)</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoAacL
                    ? JSON.parse(regularObj.json).plaqueEchoAacL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoSinusL
                    ? JSON.parse(regularObj.json).plaqueEchoSinusL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoIcaL
                    ? JSON.parse(regularObj.json).plaqueEchoIcaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoSaL
                    ? JSON.parse(regularObj.json).plaqueEchoSaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoVaL
                    ? JSON.parse(regularObj.json).plaqueEchoVaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoAacR
                    ? JSON.parse(regularObj.json).plaqueEchoAacR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoSinusR
                    ? JSON.parse(regularObj.json).plaqueEchoSinusR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoIcaR
                    ? JSON.parse(regularObj.json).plaqueEchoIcaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoSaR
                    ? JSON.parse(regularObj.json).plaqueEchoSaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).plaqueEchoVaR
                    ? JSON.parse(regularObj.json).plaqueEchoVaR
                    : ""
                  : ""
              }}
            </td>
          </tr>
          <tr>
            <td>狭窄或闭塞</td>
            <td>狭窄率(0=无狭窄，1=1-49%，2=50-69%，3=70-99%，4=闭塞)</td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateAacL
                    ? JSON.parse(regularObj.json).stenosisRateAacL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateSinusL
                    ? JSON.parse(regularObj.json).stenosisRateSinusL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateIcaL
                    ? JSON.parse(regularObj.json).stenosisRateIcaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateSaL
                    ? JSON.parse(regularObj.json).stenosisRateSaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateVaL
                    ? JSON.parse(regularObj.json).stenosisRateVaL
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateAacR
                    ? JSON.parse(regularObj.json).stenosisRateAacR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateSinusR
                    ? JSON.parse(regularObj.json).stenosisRateSinusR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateIcaR
                    ? JSON.parse(regularObj.json).stenosisRateIcaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateSaR
                    ? JSON.parse(regularObj.json).stenosisRateSaR
                    : ""
                  : ""
              }}
            </td>
            <td>
              {{
                regularObj.json
                  ? JSON.parse(regularObj.json).stenosisRateVaR
                    ? JSON.parse(regularObj.json).stenosisRateVaR
                    : ""
                  : ""
              }}
            </td>
          </tr>
        </tbody>
      </table>
      <div>
        注:①内中膜厚度为最厚测的测值；②斑块为最大斑块的测量值；③斑块数量中，一个斑块定义为单发，2个或2个以上定义为多发；④狭窄率为面积狭窄率
      </div>
    </el-dialog>
    <el-dialog
      v-model="originalVisible"
      width="1000px"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
    >
      <template #title>
        <span>{{ "视频文件" }}</span>
      </template>
      <div class="box-video">
        <div
          v-for="(item, index) in originalList"
          :key="index"
          style="display: inline-block; margin-right: 10px"
        >
          <video v-if="item" controls style="width: 450px; height: 300px">
            <source :src="item" type="video/mp4" />
          </video>
        </div>
      </div>
    </el-dialog>
    <el-dialog
      v-model="infoVisible"
      width="800px"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
    >
      <template #title>
        <span>{{ "患者信息" }}</span>
      </template>
      <el-form inline label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="条码：">
              <el-input v-model="patientForm.t_sn" disabled placeholder="请输入" style="width: 200px;" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="机构名称：">
              <el-select v-model="patientForm.insname" filterable placeholder="" style="width: 200px;">
                <el-option v-for="(item, index) in projectList" :key="index" :label="item.insname" :value="item.insname" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="姓名：">
              <el-input v-model="patientForm.name" placeholder="请输入" style="width: 200px;" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别：">
              <el-select v-model="patientForm.sex" placeholder="" style="width: 200px;">
                <el-option label="男" value="男" />
                <el-option label="女" value="女" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="年龄：">
              <el-input v-model="patientForm.age" placeholder="请输入" style="width: 200px;" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查医师：">
              <el-input v-model="patientForm.docname" placeholder="请输入" style="width: 200px;" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="联系方式：">
              <el-input v-model="patientForm.tel" placeholder="请输入" style="width: 200px;" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary" @click="submit">确定</el-button>
          <el-button @click="infoVisible = false">取消</el-button
          >
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { getUltraSoundList } from "@/apis/reportReview";
import { getSubIns, getAllSubIns, getSubInsAudit } from "@/apis/hospitalManagement";
import format from "@/utils/format";
import { ElMessage } from "element-plus";
import { updateUltraIns } from "@/apis/reportList";
export default {
  data() {
    let _this = this;
    let nowTime = new Date().getTime();
    let stime = format(nowTime, "YYYY-MM-DD") + " " + "23:59:59";
    let etime = format(nowTime, "YYYY-MM-DD") + " " + "00:00:00";
    return {
      infoVisible: false,
      patientForm: null,
      projectList: [],
      hosProps: {
        lazy: true,
        checkStrictly: true,
        label: "insname",
        value: "insname",
        lazyLoad(node, resolve) {
          _this.getJunior(node, resolve);
        },
      },
      insnameProps: {
        lazy: true,
        checkStrictly: true,
        label: "insname",
        value: "inscode",
        lazyLoad(node, resolve) {
          _this.getJunior(node, resolve);
        },
      },
      auditProps: {
        lazy: true,
        checkStrictly: true,
        label: "insname",
        value: "insname",
        lazyLoad(node, resolve) {
          _this.getAuditJunior(node, resolve);
        },
      },
      fullscreenLoading: false,
      json_fields: {
        序号: {
          field: "index",
          callback: (value) => {
            return String(value);
          },
        },
        条码: {
          field: "t_sn",
          callback: (value) => {
            return String(value);
          },
        },
        项目类型: {
          field: "project",
          callback: (value) => {
            return String(value);
          },
        },
        项目点名称: {
          field: "insname",
          callback: (value) => {
            return String(value);
          },
        },
        姓名: {
          field: "name",
          callback: (value) => {
            return String(value);
          },
        },
        性别: {
          field: "sex",
          callback: (value) => {
            return String(value);
          },
        },
        年龄: {
          field: "age",
          callback: (value) => {
            return String(value);
          },
        },
        是否阳性: {
          field: "isPositiveText",
          callback: (value) => {
            return String(value);
          },
        },
        是否有效: {
          field: "isInvalidText",
          callback: (value) => {
            return String(value);
          },
        },
        无效原因: {
          field: "invalidReason",
          callback: (value) => {
            return String(value);
          },
        },
        设备名称: {
          field: "devname",
          callback: (value) => {
            return String(value);
          },
        },
        报告状态: {
          field: "auditText",
          callback: (value) => {
            return String(value);
          },
        },

        检查时间: {
          field: "checkTime1",
          callback: (value) => {
            return String(value);
          },
        },

        检查医师: {
          field: "docname",
          callback: (value) => {
            return String(value);
          },
        },
        上传时间: {
          field: "uploadTime1",
          callback: (value) => {
            return String(value);
          },
        },
        分析医师: {
          field: "analyseDoc",
          callback: (value) => {
            return String(value);
          },
        },
        报告时间: {
          field: "reportTime1",
          callback: (value) => {
            return String(value);
          },
        },
        审核机构名称: {
          field: "auditinsname",
          callback: (value) => {
            return String(value);
          },
        },
        审核医师: {
          field: "auditname",
          callback: (value) => {
            return String(value);
          },
        },
        审核时间: {
          field: "audittm",
          callback: (value) => {
            return String(value);
          },
        },
        设备SN: {
          field: "devid",
          callback: (value) => {
            return String(value);
          },
        },
        上传状态: {
          field: "upstatus",
          callback: (value) => {
            return String(value);
          },
        },
      },
      userExcelName: "",
      tableLoading: false,
      filtrateList: [
        "t_sn",
        "project",
        "devid",
        "devname",
        "name",
        "sex",
        "age",
        "isInvalid",
        "diagnosis",
        "isPositive",
        "invalidReason",
        "checkTime",
        "insname",
        "docname",
        "uploadTime",
        "analyseDoc",
        "audittm",
        "reportTime",
        "auditinsname",
        "auditname",
        "auditstatus",
        "dicomurl",
        "upstat",
        "videourl",
        "origins",
        "upstatus"
      ],
      formInline: {
        keyword: "",
        inspectionTime: [stime, etime],
        uploadTime: [],
        reportTime: [],
        projectName: "",
        auditorName: "",
        auditorDoctor: "",
        reportStatus: "",
        isInvalid: "",
        diagnosis: "",
        isPositive: "",

      },
      tableData: [],
      pageList: {
        current: 1,
        size: 20,
        total: 0,
      },
      statusList: [
        {
          label: "待审核",
          value: "0",
        },
        {
          label: "审核中",
          value: "1",
        },
        {
          label: "退回重审",
          value: "2",
        },
        {
          label: "已审核",
          value: "10",
        },
      ],
      regularVisible: false,
      nationalVisible: false,
      originalVisible: false,
      regularObj: {},
      originalList: [],
      isUsedList: [
        {
          label: "无效",
          value: "1",
        },
        {
          label: "有效",
          value: "0",
        },
      ],
      isPositiveList: [
        {
          label: "阳性",
          value: '1',
        },
        {
          label: "阴性",
          value: '0',
        },
      ],
    };
  },
  mounted() {
    let echCerebrovascularProjectInside = localStorage.getItem(
      "echCerebrovascularProjectInside"
    );
    if (echCerebrovascularProjectInside) {
      this.filtrateList = JSON.parse(echCerebrovascularProjectInside);
    }
    this.init();
    this.saveCookie();
    this.getJunior()
  },
  methods: {
    edit(row) {
      this.patientForm = row
      console.log(row, 'row')
      console.log(this.patientForm, 'patientForm')
      this.infoVisible = true
    },
    submit() {
      console.log(this.patientForm, 'this.patientForm')
      let hospitalInfo = []
      if (this.patientForm.inscode) {
        hospitalInfo = this.projectList.filter(item => {
          return item.inscode == this.patientForm.inscode
        })
      }
      if (hospitalInfo.length > 0) {
        this.patientForm.insname = hospitalInfo[0].insname
      }
      updateUltraIns({
        uname: this.$store.getters.rname,
        inscode: this.$store.getters.inscode,
        data: JSON.stringify(this.patientForm),
      }).then(res => {
        if (res.code == 0) {
          ElMessage({
            message: '编辑成功！',
            type: 'success',
          });
          this.getTableData()
        } else {
          ElMessage({
            message: res.error,
            type: 'error',
          });
        }
        this.infoVisible = false
      })
    },
    getAuditJunior(node, resolve) {
      let subins = "";
      if (node.value) {
        subins = node.value;
      }
      getSubInsAudit({
        uname: this.$store.getters.name,
        inscode: this.$store.getters.inscode,
        subins: subins,
      }).then((res) => {
        if (res.code == 0) {
          if (res.data && res.data.length > 0) {
            resolve(res.data);
          } else {
            resolve([]);
          }
        } else {
          resolve([]);
        }
      });
    },
    getJunior() {
      this.projectList = []
      getAllSubIns({
        uname: this.$store.getters.name,
        inscode: this.$store.getters.inscode,
        subins: '',
      }).then((res) => {
        if (res.code == 0) {
          if (res.data && res.data.length > 0) {
            this.projectList = res.data
          }
        }
      });
    },
    saveCookie() {
      let echCerebrovascularProjectInside = JSON.stringify(this.filtrateList);
      localStorage.setItem(
        "echCerebrovascularProjectInside",
        echCerebrovascularProjectInside
      );
    },
    changeBox() {
      let echCerebrovascularProjectInside = JSON.stringify(this.filtrateList);
      localStorage.setItem(
        "echCerebrovascularProjectInside",
        echCerebrovascularProjectInside
      );
    },
    async downloadEx() {
      let insTitle = this.$store.getters.insname
        ? this.$store.getters.insname
        : "";
      let inspecSTime = "";
      let inspecETime = "";
      let data = [];
      this.fullscreenLoading = true;
      if (
        this.formInline.inspectionTime &&
        this.formInline.inspectionTime.length > 0
      ) {
        inspecSTime = this.formInline.inspectionTime[0];
        inspecETime = this.formInline.inspectionTime[1];
        this.userExcelName =
          insTitle + "_超声报告列表_" + inspecSTime + "~" + inspecETime;
        let res = await getUltraSoundList({
          page: 1, // 当前页
          size: 10000, // 每页size
          uname: this.$store.getters.name, // 登录用户
          insname: this.$store.getters.insname, //用户机构名
          keyword: this.formInline.keyword ? this.formInline.keyword : "", // 关键字
          inspectionStime: this.formInline.inspectionTime
            ? this.formInline.inspectionTime[0]
              ? this.formInline.inspectionTime[0]
              : ""
            : "", // 检查开始时间
          inspectionEtime: this.formInline.inspectionTime
            ? this.formInline.inspectionTime[1]
              ? this.formInline.inspectionTime[1]
              : ""
            : "", // 检查结束时间
          uploadStime: this.formInline.uploadTime
            ? this.formInline.uploadTime[0]
              ? this.formInline.uploadTime[0]
              : ""
            : "", //上传开始时间
          uploadEtime: this.formInline.uploadTime
            ? this.formInline.uploadTime[1]
              ? this.formInline.uploadTime[1]
              : ""
            : "", //上传结束时间
          reportStime: this.formInline.reportTime
            ? this.formInline.reportTime[0]
              ? this.formInline.reportTime[0]
              : ""
            : "", //报告开始时间
          reportEtime: this.formInline.reportTime
            ? this.formInline.reportTime[1]
              ? this.formInline.reportTime[1]
              : ""
            : "", //报告结束时间
          projectName: this.formInline.projectName, //项目点名称
          auditorName: this.formInline.auditorName, //审核机构名称
          auditorDoctor: this.formInline.auditorDoctor
            ? this.formInline.auditorDoctor
            : "", //审核医师
          reportStatus: this.formInline.reportStatus
            ? this.formInline.reportStatus
            : "", //报告状态
          project: "脑卒中",
          isPositive: this.formInline.isPositive,
          isInvalid: this.formInline.isInvalid,
          diagnosis: this.formInline.diagnosis,
        });
        if (res.code == 0) {
          if (res.data && res.data.length > 0) {
            res.data.forEach((el, index) => {
              let auditText = "";
              el.index = index + 1;
              el.upstatus = ''
              if (el.upstat == 200) {
                el.upstatus = '上传成功'
              } else {
                el.upstatus = '上传失败'
              }
              if (el.auditstatus == 0) {
                auditText = "待审核";
              } else if (el.auditstatus == 1) {
                auditText = "审核中";
              } else if (el.auditstatus == 2) {
                auditText = "退回重审";
              } else if (el.auditstatus == 10) {
                auditText = "已审核";
              }
              el.auditText = auditText;
              el.isInvalidText = el.isInvalid == 0 ? "有效" : "无效";
              el.isPositiveText = el.isPositive == "1" ? "阳性" : el.isPositive == "0" ? "阴性" : "";

              el.checkTime1 = format(
                el.checkTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.uploadTime1 = format(
                el.uploadTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.reportTime1 = format(
                el.reportTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.checkTime2 = format(el.checkTime * 1000, "YYYY-MM-DD");
              el.ctime2 = format(el.ctime * 1000, "YYYY-MM-DD");
              el.reportTime2 = format(el.reportTime * 1000, "YYYY-MM-DD");
              el.audittm = format(el.audittm * 1000, "YYYY-MM-DD");
            });
            data = res.data;
          }
        }
        this.fullscreenLoading = false;
        return data;
      } else {
        ElMessage({
          message: "请选择检查时间",
          type: "warning",
        });
        this.fullscreenLoading = false;
        return data;
      }
    },
    init() {
      this.getTableData();
    },
    getTableData() {
      this.tableData = [];
      this.tableLoading = true;
      getUltraSoundList({
        page: this.pageList.current, // 当前页
        size: this.pageList.size, // 每页size
        uname: this.$store.getters.name, // 登录用户
        insname: this.$store.getters.insname, //用户机构名
        keyword: this.formInline.keyword ? this.formInline.keyword : "", // 关键字
        inspectionStime: this.formInline.inspectionTime
          ? this.formInline.inspectionTime[0]
            ? this.formInline.inspectionTime[0]
            : ""
          : "", // 检查开始时间
        inspectionEtime: this.formInline.inspectionTime
          ? this.formInline.inspectionTime[1]
            ? this.formInline.inspectionTime[1]
            : ""
          : "", // 检查结束时间
        uploadStime: this.formInline.uploadTime
          ? this.formInline.uploadTime[0]
            ? this.formInline.uploadTime[0]
            : ""
          : "", //上传开始时间
        uploadEtime: this.formInline.uploadTime
          ? this.formInline.uploadTime[1]
            ? this.formInline.uploadTime[1]
            : ""
          : "", //上传结束时间
        reportStime: this.formInline.reportTime
          ? this.formInline.reportTime[0]
            ? this.formInline.reportTime[0]
            : ""
          : "", //报告开始时间
        reportEtime: this.formInline.reportTime
          ? this.formInline.reportTime[1]
            ? this.formInline.reportTime[1]
            : ""
          : "", //报告结束时间
        projectName: this.formInline.projectName, //项目点名称
        auditorName: this.formInline.auditorName, //审核机构名称
        auditorDoctor: this.formInline.auditorDoctor
          ? this.formInline.auditorDoctor
          : "", //审核医师
        reportStatus: this.formInline.reportStatus
          ? this.formInline.reportStatus
          : "", //报告状态
        project: "脑卒中",
        isInvalid: this.formInline.isInvalid,
        diagnosis: this.formInline.diagnosis,
        isPositive: this.formInline.isPositive,
      }).then((res) => {
        if (res.code == 0) {
          if (res.data && res.data.length > 0) {
            res.data.forEach((el) => {
              el.isEdit = false
              el.checkTime1 = format(
                el.checkTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.uploadTime1 = format(
                el.uploadTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.reportTime1 = format(
                el.reportTime * 1000,
                "YYYY-MM-DD HH:mm:ss"
              );
              el.checkTime2 = format(el.checkTime * 1000, "YYYY-MM-DD");
              el.ctime2 = format(el.ctime * 1000, "YYYY-MM-DD");
              el.reportTime2 = format(el.reportTime * 1000, "YYYY-MM-DD");
              el.audittm = format(el.audittm * 1000, "YYYY-MM-DD");
            });
            this.tableData = res.data;
            this.pageList.total = res.size;
          }
          this.tableLoading = false;
        }
      });
    },
    // 搜索
    search() {
      this.pageList.current = 1;
      this.getTableData();
    },
    // 重置
    reset() {
      let nowTime = new Date().getTime();
      let stime = format(nowTime, "YYYY-MM-DD") + " " + "23:59:59";
      let etime = format(nowTime, "YYYY-MM-DD") + " " + "00:00:00";
      this.formInline.keyword = "";
      this.formInline.inspectionTime = [stime, etime];
      this.formInline.uploadTime = [];
      this.formInline.reportTime = [];
      this.formInline.projectName = "";
      this.formInline.auditorName = "";
      this.formInline.auditorDoctor = "";
      this.formInline.isInvalid = "";
      this.formInline.diagnosis = "";
      this.formInline.isPositive = "";
      this.formInline.reportStatus = "";
      this.pageList.current = 1;
      this.pageList.size = 20;
      this.getTableData();
    },
    // 点击常规报告
    regularInfo(row) {
      console.log(row, "row");
      this.regularObj = {};
      this.regularObj = row;
      this.regularVisible = true;
    },
    // 点击国家报告
    nationalInfo(row) {
      console.log(row, "row");
      console.log(row.json, "json");
      console.log(JSON.parse(row.json), "parse");
      this.regularObj = {};
      this.regularObj = row;
      this.nationalVisible = true;
    },
    // 点击原始影像
    originalInfo(row) {
      console.log(row, "row");
      if (row.videourl) {
        this.originalList = [];
        this.originalList = JSON.parse(row.videourl);
        console.log(this.originalList, "originalList");
        this.originalVisible = true;
      } else {
        ElMessage({
          message: "暂无影像",
          type: "warning",
        });
      }
    },
    handleSizeChange(val) {
      this.pageList.current = 1;
      this.pageList.size = val;
      this.getTableData();
    },
    handleCurrentChange(val) {
      this.pageList.current = val;
      this.getTableData();
    },
  },
};
</script>
